/**
 * Created with IntelliJ IDEA.
 * Description:输出闰年
 * User: xwl
 * Date: 2023-03-30
 * Time: 21:12
 */
public class Test4 {
    public static void main(String[] args) {
        //定义一个计数器，使输出好看
        int count = 0;
        //循环判断是否是闰年
        for (int i = 1000; i <=2000 ; i++) {
            if(((i%4 == 0) && (i/100 != 0)) || (i%400 == 0)) {
                //输出
                System.out.print(i + " ");
                count++;
            }
            //判断输出换行
            if(count == 20) {
                System.out.println(" ");
                count = 0;
            }
        }
    }
}
